// 分类名称映射
const categoryNames: Record<string, string> = {
  optics: "光学实验",
  electricity: "电学实验",
  mechanics: "力学实验",
  thermodynamics: "热学实验",
  modern: "现代物理实验",
  comprehensive: "综合实验",
  dev: "开发文档",
};

/**
 * 根据分类ID获取分类名称
 * @param categoryId 分类ID
 * @returns 分类名称或undefined
 */
export function getCategoryName(categoryId: string): string | undefined {
  return categoryNames[categoryId];
}

/**
 * 获取所有分类信息
 * @returns 分类信息数组
 */
export function getAllCategories() {
  return Object.entries(categoryNames).map(([id, name]) => ({
    id,
    name,
    icon: getCategoryIcon(id),
  }));
}

/**
 * 根据分类ID获取图标
 * @param categoryId 分类ID
 * @returns 分类图标
 */
function getCategoryIcon(categoryId: string): string {
  const icons: Record<string, string> = {
    optics: "🔍",
    electricity: "⚡",
    mechanics: "🎯",
    thermodynamics: "🌡️",
    modern: "⚛️",
    comprehensive: "🔬",
    dev: "📚",
  };

  return icons[categoryId] || "📋";
}
